home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / turbo_tk.arc / MOUSEDEM.PAS < prev    next >
Pascal/Delphi Source File  |  1988-02-01  |  1KB  |  41 lines

  1. Program Mouse_Test;
  2.  
  3. uses Crt, FastTTT, DOS, KeyTTT;
  4.  
  5. var
  6.   B: button;
  7.   H,V: integer;
  8.   Ch : char;
  9.  
  10. begin
  11.   Clrscr;
  12.   If not Moused then
  13.      PlainWrite(1,1,'This demo only functions on PC''s equipped with a mouse')
  14.   else
  15.   begin
  16.       Move_Mouse(5,5);
  17.       WriteCenter(1,white,black,'Press the left mouse button to change cursor');
  18.       Show_Mouse_Cursor;
  19.       Repeat
  20.            Get_Mouse_Action(B,H,V);
  21.       Until B = LeftB;
  22.       Set_Mouse_Cursor_Style(4);   {chr(4) is a diamond}
  23.       Hide_Mouse_Cursor;
  24.       ClearLine(1,white,black);
  25.       Box(20,5,60,15,white,black,4);
  26.       WriteCenter(1,white,black,'The mouse is now confined in the Box');
  27.       WriteCenter(2,white,black,'Move the mouse around, press Right Button when finished');
  28.       Confine_Mouse_Horiz(21,59);
  29.       Confine_Mouse_Vert(6,14);
  30.       Show_Mouse_Cursor;
  31.       Repeat
  32.            Get_Mouse_Action(B,H,V);
  33.       Until B = RightB;
  34.       Clrscr;
  35.       WriteCenter(1,white,black,'You''ve passed the basic test!');
  36.       Hide_Mouse_Cursor;
  37.   end;
  38.   WriteAT(1,24,white,black,'Run DemoTTT.exe for the main demo program');
  39.   WriteAT(1,25,white,black,'Technojocks Turbo Toolkit v4.0');
  40.   Ch := Readkey;
  41. end.